package com.kfm.base.io.o;

import java.io.*;

public class Demo {

    public static void main(String[] args) {
        // What Where How Why
        try(ByteArrayOutputStream baos = new ByteArrayOutputStream();
                ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("text/serializable.txt"));) {
//
//            oos.writeChar('你');
//
//            oos.writeBoolean(true);

            Student student = new Student("张三", 88.8, "男");

            oos.writeObject(student);


        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}


